package cn.jdy.plugins.wap;

import java.util.HashMap;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.jdy.common.ctrl.BaseCtrl;
import cn.jdy.framework.log.BaseLog;

/**
 * 积分商城 控制类
 * Created by zhaigt on 2014/8/26.
 */
@Controller
@RequestMapping("/scoremall")
public class ScoreMallCtrl extends BaseCtrl {

	/**
	 * 积分商城列表
	 * @return
	 */
	@RequestMapping("")
	public ModelAndView list(String type,String title) {
		ModelAndView mv = new ModelAndView(super.t + "/scoremall");
		try {
		  // 积分类型
//		  List<ConfValue> list = new ArrayList<ConfValue>();
		  HashMap<String,String> datatype = new HashMap<String,String>();
		  datatype.put("01", "商务伴侣");
		  datatype.put("02", "特色礼品");
			mv.addObject("dataType", datatype);
			//id 图片，标题，价格，描述
			mv.addObject("items",  null);
			mv.addObject("title",  title);
		} catch(Exception e) {
			BaseLog.e(this.getClass(), "list", e);
		}
		return mv;
	}

	/**
	 * 查看积分商品详情
	 *
	 * @param id
	 * @return
	 */
	@RequestMapping("/{id}")
	public ModelAndView detail(@PathVariable Long id,String title) {
		ModelAndView mv = new ModelAndView(super.t + "/scoremallDetail");
		try {
		  mv.addObject("dataType", null);
      mv.addObject("item",  null);
      mv.addObject("title",  title);
		} catch(Exception e) {
			BaseLog.e(this.getClass(), "detail", e);
		}
		return mv;
	}
	 
}
